﻿using System;
using System.ComponentModel.DataAnnotations;
using Xcj.Mes.WholeLine.DataBase.Common;

namespace Xcj.Mes.WholeLine.DataBase.Entity
{
    public class AlarmEntity : BaseEntity
    {
        private string _deviceSn = string.Empty;
        [Alias("机台编码"), StringLength(32)]
        public string DeviceSn { get => _deviceSn; set { _deviceSn = value; RaisePropertyChanged(); } }

        // 钉卷 组立 老化 座板 其它
        private string _deviceType = string.Empty;
        [Alias("设备类型"), StringLength(32)]
        public string DeviceType { get => _deviceType; set { _deviceType = value; RaisePropertyChanged(); } }

        private string _alarmAddress = string.Empty;
        [Alias("报警地址"), StringLength(64)]
        public string AlarmAddress { get => _alarmAddress; set { _alarmAddress = value; RaisePropertyChanged(); } }

        private string _alarmCode = string.Empty;
        [Alias("报警代码"), StringLength(64)]
        public string AlarmCode { get => _alarmCode; set { _alarmCode = value; RaisePropertyChanged(); } }

        private string _alarmContent = string.Empty;
        [Alias("报警内容"), StringLength(128)]
        public string AlarmContent { get => _alarmContent; set { _alarmContent = value; RaisePropertyChanged(); } }

        private DateTime _startTime = DateTime.Now;
        [Alias("开始时间")]
        public DateTime StartTime { get => _startTime; set { _startTime = value; RaisePropertyChanged(); } }

        private DateTime? _stopTime;
        [Alias("结束时间")]
        public DateTime? StopTime { get => _stopTime; set { _stopTime = value; RaisePropertyChanged(); } }
        
        private double _alarmDuration = 0;
        [Alias("报警时长")]
        public double AlarmDuration { get => _alarmDuration; set { _alarmDuration = value; RaisePropertyChanged(); } }
        
        private int _alarmTimes = 0;
        [Alias("报警次数")]
        public int AlarmTimes { get => _alarmTimes; set { _alarmTimes = value; RaisePropertyChanged(); } }
    }
}
